# pure-ftpd
# Builds from https://github.com/puppylinux-woof-CE/petbuilds
# File auto generated by ./mk_petbuild.sh. Edit as necessary.

. ../func
. ../build.conf

URL=https://download.pureftpd.org/pub/pure-ftpd/releases
PKG=pure-ftpd
VER=1.0.47
COMP=tar.gz
DESC="small ftp server ideal for file sharing"
DEPS=
CAT=BuildingBlock
DESKTOP=pure-ftpd.desktop
BUILD=
CWD=$(pwd)
[ -z "$MWD" ] && MWD=$(dirname $CWD)
[ -z "$BUILD" ] && BUILD=$DEF_BUILD
# comment these 2 below if you use a custom package() function
[ -f "$DESKTOP" ] || DESKTOP=not
[ -z "$DEPS" ] && DEPS=not

ARCH=$(uname -m)
case $ARCH in # set in build.conf
 *64) 	LIBDIR=$LIBCONF64 ;;
 arm*)	LIBDIR=$LIBCONFarm;;
 *) 	LIBDIR=$LIBCONF32 ;;
esac

build() {
	cd ${PKG}-${VER}
	./configure \
		--prefix=/usr \
		--libdir=/usr/${LIBDIR} \
		--localstatedir=/var \
		--sysconfdir=/etc \
		--with-minimal
	make || exit 1
	make DESTDIR=${CWD}/${PKG}-install install
	install -m 0755 ${CWD}/run-pureftpd ${CWD}/${PKG}-install/usr/sbin/
	cd -
}

# main
retrieve ${PKG}-${VER}.${COMP}
extract ${PKG}-${VER}.${COMP}
build
package_std $PKG $VER $ARCH $DESKTOP "$DESC" $DEPS $CAT
